﻿@using CVsharp.Models.Entities
@{
    Layout = null;
}
<ul id="PermissionTree">
    @foreach (string ControllerName in ((List<sysActionPermission>)ViewData["aps"]).Select(m => m.ControllerName).Distinct())
    {
                        
        <li><span>@ControllerName</span>
            <ul>
                @foreach (sysActionPermission ap in ((List<sysActionPermission>)ViewData["aps"]).Where(m => m.ControllerName == ControllerName).OrderByDescending(m => m.IsViewPage))
                {
                    <li><span>@ap.Description:@ap.ActionName
                        @if (ap.IsViewPage)
                        {
                            <text>(页面)</text>
                        }
                        else
                        { 
                            <text>(功能)</text>
                        }
                    </span></li>
                }
            </ul>
        </li>
    }
</ul>
